<?php
include($modRootPath.'lib/dbaFormmailer.o.inc.php');

if (!$usr->checkPermission($env->getParam('instance').'_mod_formmailer_atext','v')):
	print "<b>Sie haben nicht die entsprechenden Rechte, um diese Einstellung zu sehen!</b>";
else:

$fdba = new dbaFormmailer($udba);

if (!$fdba->aditionalExists($instance))
{
    $fdba->createAditional($instance);
}

if ($env->getParam('action')=='update' && $usr->checkPermission($env->getParam('instance').'_mod_formmailer_atext','u'))
{
    $fdba->updateAditional($instance, $env->getParam('errormsg'), $env->getParam('finscreen'));
}

$tpl = $fdba->getAditional($instance);

?>
<script language="javascript" src="<?=$modRootUrl?>lib/js/ua.js">
</script>
<script language="javascript">
<!--
    function createImage (src,width,height)
    {
        var img = new Image(width,height)
        img.src = src
        return img
    }
    
    var rmouse = createImage('<?=$modRootUrl?>lib/img/rainbow_mouse.gif',27,23)
//-->
</script>
<form action="<?=$formaction?>" method="POST" name="dbform" onsubmit="document.working_mouse.src=rmouse.src">
<input type="hidden" name="action" value="update">
<input type="hidden" name="instance" value="<?=$env->getParam('instance')?>">
<input type="hidden" name="module" value="<?=$env->getParam('module')?>">
<input type="hidden" name="target" value="<?=$env->getParam('target')?>">
<input type="hidden" name="type" value="<?=$env->getParam('type')?>">
<table border="0" cellpadding="5" cellspacing="0">
<tr>
   <td bgcolor="#3FB2EB" colspan="2">
    <b>Zus&auml;tzliche Texte einrichten:</b> <img src="<?=$modRootUrl?>lib/img/0.gif" width="27" height="23" align="middle" id="working_mouse" /></td>
</tr>
<tr>
   <td bgcolor="#E0F6FD">
    Fehlermeldung:</td>
    <td bgcolor="#E0F6FD">
        <textarea name="errormsg" cols="40" rows="20" /><?=htmlspecialchars($tpl['errormsg'])?></textarea>
    </td>
</tr>
<tr>
   <td bgcolor="#E0F6FD">
    Endbildschirm:</td>
    <td bgcolor="#E0F6FD">
        <textarea name="finscreen" cols="40" rows="20" /><?=htmlspecialchars($tpl['finscreen'])?></textarea>
    </td>
</tr>
<tr>
   <td bgcolor="#E0F6FD" colspan="2" align="center">
<?php if ($usr->checkPermission($env->getParam('instance').'_mod_formmailer_atext','u')): ?>
    <input type="submit" class="button" value="&auml;ndern" /> <input type="reset" class="button" value="zur&uuml;cksetzen" /><?php
    endif; ?></td>
</tr>
</table><br />

</form>
<?php
endif; ?>